<html>
    <head>
        <title>Contoh Page</title>
        <style>
            div{margin-bottom:5px}
            .list{margin-left:7px}
        </style>
    </head>
    <body>
        <div>Revenue:</div>
        <div class="list">&gt; <b>Subtotal</b>: <?= $revenue['subtotal'] ?></div>
        <div class="list">&gt; <b>Discount</b>: <?= $revenue['discount'] ?></div>
        <div class="list">&gt; <b>Serv. Charge</b>: <?= $revenue['service'] ?></div>
        <div class="list">&gt; <b>Tax</b>: <?= $revenue['tax'] ?></div>
        <div class="list">&gt; <b>Rounding</b>: <?= $revenue['rounding'] ?></div>
        <?php
            $total = $revenue['subtotal'] - $revenue['discount'] + $revenue['service'] + $revenue['tax'] + $revenue['rounding'];
        ?>
        <div class="list">&gt; <b>Total</b>: <?= $total ?></div>

        <div>Payment (media collection):</div>
        <div class="list">&gt; <?= $media_collection['BCA CARD']['count'] ?>x <b>BCA CARD</b>: <?= $media_collection['BCA CARD']['total'] ?></div>
        <div class="list">&gt; <?= $media_collection['CITY LEDGER']['count'] ?>x <b>CITY LEDGER</b>: <?= $media_collection['CITY LEDGER']['total'] ?></div>
        <div class="list">&gt; <?= $media_collection['CASH']['count'] ?>x <b>CASH</b>: <?= $media_collection['CASH']['total'] ?></div>
        <div class="list">&gt; <?= $media_collection['VISA']['count'] ?>x <b>VISA</b>: <?= $media_collection['VISA']['total'] ?></div>
        <div class="list">&gt; <?= $media_collection['DEBIT']['count'] ?>x <b>DEBIT</b>: <?= $media_collection['DEBIT']['total'] ?></div>
        <div class="list">&gt; <?= $media_collection['MASTER']['count'] ?>x <b>MASTER</b>: <?= $media_collection['MASTER']['total'] ?></div>
        <?php
            $total = $media_collection['BCA CARD']['total'] + $media_collection['CITY LEDGER']['total'] + $media_collection['CASH']['total'] + $media_collection['VISA']['total'] + $media_collection['DEBIT']['total'] + $media_collection['MASTER']['total'];
        ?>
        <div class="list">&gt; <b>Total</b>: <?= $total ?></div>
        
        <div>Department:</div>
        <div class="list">&gt; <?= $department['BEVERAGE']['count'] ?>x <b>BEVERAGE</b>: <?= $department['BEVERAGE']['total'] ?></div>
        <div class="list">&gt; <?= $department['FOOD']['count'] ?>x <b>FOOD</b>: <?= $department['FOOD']['total'] ?></div>
        <div class="list">&gt; <?= $department['TOBACO']['count'] ?>x <b>TOBACO</b>: <?= $department['TOBACO']['total'] ?></div>
        <div class="list">&gt; <?= $department['OTHERS']['count'] ?>x <b>OTHERS</b>: <?= $department['OTHERS']['total'] ?></div>
        <?php
            $total = $department['BEVERAGE']['total'] + $department['FOOD']['total'] + $department['TOBACO']['total'] + $department['OTHERS']['total'];
        ?>
        <div class="list">&gt; <b>Total</b>: <?= $total ?></div>
        
        <div>Sales</div>
        <table>
            <tr>
                <th>Date</th>
                <th>Beverage</th>
                <th>Food</th>
                <th>Tobaco</th>
                <th>Others</th>
                <th>Discount</th>
                <th>Rounding</th>
                <th>Net Sales</th>
                <th>Tax</th>
                <th>Service</th>
                <th>Subtotal</th>
            </tr>
            <tr>
            <? foreach($sales as $val): ?>
                <td><?=$val?></td>
            <? endforeach; ?>
            </tr>
        </table>
    </body>
</html>